
import HttpClient from '../utils/request';

import type { loginReqType, loginResType, info ,userPasswordReqType} from './../types/loginType';

// 获取用户列表
export const login = (e: loginReqType) => {
    return HttpClient.request<loginResType>({
        url:'/platform/verification/login',
        method:"POST",
        data:e,
        headers: {
            "Content-type": "application/json"
        }
    });
}

// 获取用户信息
export const getUserInfo = () => {
    return HttpClient.request<info>( {
        url:'/platform/user/userInfo',
        method:"POST",
        headers: {
            "Content-type": "application/json"
        }
    });
}

// 获取公钥
export const getPublicKey = () => {
    return HttpClient.request<string>( {
        url:'/platform/verification/getPublicKey',
        method:"POST",
        headers: {
            "Content-type": "application/json"
        }
    });
}

// 修改密码
export const updatePassword = (data:userPasswordReqType) => {
    return HttpClient.request( {
        url:'/platform/user/updatePassword',
        method:"POST",
        data,
        headers: {
            "Content-type": "application/json"
        }
    });
}


